home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / t_unix / j109lxa4.tar / netuser.h < prev    next >
C/C++ Source or Header  |  1994-06-04  |  2KB  |  62 lines

  1. /* Mods by G1EMM */
  2. #ifndef _NETUSER_H
  3. #define _NETUSER_H
  4.  
  5. /* Global structures and constants needed by an Internet user process */
  6.  
  7. #ifndef _GLOBAL_H
  8. #include "global.h"
  9. #endif
  10.  
  11. #define NCONN   20              /* Maximum number of open network connections */
  12.  
  13. extern int32 Ip_addr;   /* Our IP address */
  14. extern int Net_error;   /* Error return code */
  15. #define NONE            0       /* No error */
  16. #define CON_EXISTS      1       /* Connection already exists */
  17. #define NO_CONN         2       /* Connection does not exist */
  18. #define CON_CLOS        3       /* Connection closing */
  19. #define NO_MEM          4       /* No memory for TCB creation */
  20. #define WOULDBLK        5       /* Would block */
  21. #define NOPROTO         6       /* Protocol or mode not supported */
  22. #define INVALID         7       /* Invalid arguments */
  23.  
  24. #define INET_EOL        "\r\n"  /* Standard Internet end-of-line sequence */
  25.  
  26. /* Codes for the tcp_open call */
  27. #define TCP_PASSIVE     0
  28. #define TCP_ACTIVE      1
  29. #define TCP_SERVER      2       /* Passive, clone on opening */
  30.  
  31. /* Local IP wildcard address */
  32. #define INADDR_ANY      0x0L
  33.  
  34. /* Socket structure */
  35. #ifdef UNIX
  36. #ifndef socket
  37. #include "socket.h"
  38. #endif
  39. #endif
  40. struct socket {
  41.     int32 address;          /* IP address */
  42.     int16 port;             /* port number */
  43. };
  44. #define NULLSOCK        (struct socket *)0
  45.  
  46. /* Connection structure (two sockets) */
  47. struct connection {
  48.     struct socket local;
  49.     struct socket remote;
  50. };
  51. /* In domain.c: */
  52. int32 resolve __ARGS((char *name));
  53. int32 resolve_mx __ARGS((char *name));
  54.  
  55. /* In netuser.c: */
  56. int32 aton __ARGS((char *s));
  57. char *inet_ntoa __ARGS((int32 a));
  58. char *pinet __ARGS((struct socket *s));
  59. char *inet_ntobos __ARGS((int32 a));
  60.  
  61. #endif  /* _NETUSER_H */
  62.